import os
from google.appengine.api import users
from google.appengine.ext import db
from datetime import datetime

import django
from django import http
from django import shortcuts
from blog.models import *
from blog.helper import *
from blog.sessions import *
from blog.relativedelta import *
from conf.settings import *



def GetRow(kind,where):
    sql = "SELECT * FROM " +kind+ " WHERE " + where +" LIMIT 1"
    items = db.GqlQuery(sql)
    if items:
        item = items.get()
        return item
    return None 

def GetRows(kind,where):
    sql = "SELECT * FROM " +kind+ " WHERE " + where
    items = db.GqlQuery(sql)
    if items:
        return items
    return None 
